<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateOpenShopPreparationOrderRefundStream extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('open_shop_preparation_order_refund_stream', function (Blueprint $table) {
            $table->id();
            $table->string('orderNo')->default('')->comment('主订单编号');
            $table->string('preparationNo')->default('')->comment('筹备订单号');
            $table->string('refundSerialNo')->default('')->comment('退款流水号');
            $table->integer('money')->default(0)->comment('退款金额');
            $table->unsignedTinyInteger('type')->default(0)->comment('退款类型0:设计费1:商户通2:软装报价3:装修保证金');
            $table->unsignedTinyInteger('refundType')->default(0)->comment('退款方式0 手动记录');
            $table->string('remark')->default('')->comment('退款备注');
            $table->string('refuseRemark')->default('')->comment('拒绝退款备注');
            $table->unsignedTinyInteger('status')->default(0)->comment('0未退款 1 已退款 2拒绝退款 ');
            $table->unsignedTinyInteger('isDeleted')->default(0)->comment('是否删除 0否 1 是');
            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('createdByUid')->default(0)->comment('创建人');
            $table->unsignedInteger('updatedAt')->default(0)->comment('修改时间');
            $table->unsignedInteger('updatedByUid')->default(0)->comment('修改人');
            $table->index('preparationNo', 'idx_preparationNo');
            $table->index('orderNo', 'idx_orderNo');
            $table->collation = 'utf8mb4_general_ci';
            $table->comment   = '筹备退款表';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('open_shop_preparation_order_refund_stream');
    }
}
